#pragma once
#include <Handle_TDocStd_Document.hxx>
#include <TDF_Label.hxx> 
#include <list>

class CAnyApplicaton;
class CAnyView;
class IDocListener;
class CEditorData;
class CUndoManager;

class  GEOMDBAPI CAnyDocument
{
public:
	CAnyDocument(Handle_TDocStd_Document hDoc);
	~CAnyDocument(void);

	// new 
	void NewDocument(const CString& szName);
	void CloseDocument();
	
	const CString& GetDocName(){return m_szDocName;}
	void SetActive(bool bActive);
	// listeners
	bool AddListener(IDocListener* pDocListener);
	bool RemoveListener(IDocListener* pDocListener);

	// undo/redo
	void SetUndoLimit(UINT nLimit);

	// data management
	TDF_Label GetRootLabel();
	bool AddShape(TDF_Label& subLabel, CEditorData& edData);

	// browse the label tree
	void BrowserTree();

	// internal used only
	Handle_TDocStd_Document& GetStdDoc(){return m_hOcafDoc;}

	CUndoManager* GetUndoMgr(){return m_pUodoManager;}
protected:
	CString	m_szDocName;
	Handle_TDocStd_Document m_hOcafDoc;

	typedef std::list<IDocListener*> DocListenerList;
	DocListenerList m_listListeners;

	CUndoManager* m_pUodoManager;
};
